#!/usr/bin/python
##Creates the files that LazyFile reads from
#Copyright (C) 2008 Laseredd1
#This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
#This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA


class LAZYscript():
    
    def init(self, Fname):
        self.fname = Fname
        self.script = file(self.fname, "w")
        
    def write(self, txt):
        self.txt = txt + "\n"
        self.script.write(self.txt)
        
    def uninit(self):
        self.script.close()

if __name__ == "__main__":
    print "Lazyfile Configuration Tool"
    print
    print "Lazyfile, Copyright (C) 2008 Laseredd. Lazyfile comes \
with ABSOLUTELY NO WARRANTY; for details see license.txt. This is free \
software, and you are welcome to redistribute it under certain conditions; \
see license.txt for details."
    print
    
    conf = file("lazyfile.conf", "w")
    confloc = "Scripts/" 
    #confloc = str(raw_input("Where to store the LazyFile scripts? "))
    direct = "./" 
    #direct = str(raw_input("Directory to search in: "))
    conf.write(confloc)
    conf.close()

    while True:
        scr = LAZYscript()
        pri = int(raw_input("What is the priority number? "))
        fname = str(pri) + str(raw_input("Filename: ")) + ".LAZY"
        scr.init(confloc + "/" + fname)
        scr.write(direct)
        scr.write(str(raw_input("What to search for in filenames: ")))
        scr.write(str(raw_input("Directory to move files to: ")))
        scr.uninit()
        print "Press Control-C to exit, to create another file, keep going. "
        print
